package com.xuni.neo4j.dao;

import com.xuni.neo4j.base.BaseRelation;
import com.xuni.neo4j.entity.Movie;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MovieRepository extends Neo4jRepository<Movie, Long> {

//    @Query("MATCH (n:Movie)-[r:`关系`]-(p:Person) return n,r,p;")
    @Query("MATCH (n:Movie)-[r:`关系1`]-(p:Person) return n,r,p;")
    List<Movie> queryMovie();

    @Query("MATCH ()-[:`关系1`]->() RETURN count(*)")
//    @Query("MATCH ()-->() RETURN count(*);")
    Long queryRelations();
}
